
//类：人
class Person{
    //成员属性/变量
    public String name;
    public int age;

    //成员行为/方法
    public void eat(){
        System.out.println("吃饭！");
    }
}

class DateUtil{
    public int year;
    public int month;
    public int day;
    public DateUtil(){
        this(1999,9,9);
        System.out.println("不带参数的构造方法！");
    }
    public DateUtil(int year,int month,int day){
        this.year = year;
        this.month = month;
        this.day = day;
        System.out.println("调用了带有3个参数的构造方法！");
    }
    public void show(){
        System.out.println("年："+this.year+"月："+this.month+"日："+this.day);
    }
}


public class Test1 {
    public static void main(String[] args) {
        //实例化一个 人 对象
        Person person = new Person();

        //访问成员 属性
        person.name = "王";
        person.age = 12;

        DateUtil dateUtil = new DateUtil(2022,11,14);
        dateUtil.show();



    }
}
